import { stringify } from 'querystring';
import request from '../utils/request';

export async function getSectionChiefStaff({ deptIds, generalStaff }) {
  return request(`/open/getSectionChiefStaff?deptIds=${deptIds}&generalStaff=${generalStaff}`, {
    method: 'get',
  });
}

export async function createDemocracyEvaluation({ form, cadre, staff }) {
  let fm = new FormData()
  fm.append('form', form ? JSON.stringify(form) : '')
  fm.append('cadre', cadre ? JSON.stringify(cadre) : '')
  fm.append('staff', staff ? JSON.stringify(staff) : '')
  return request('/open/createDemocracyEvaluation', {
    method: 'POST',
    headers: { 'content-type': 'multipart/form-data' },
    body: fm
  });
}

export async function checkDemocracyEvaluationTime() {
  return request(`/open/checkDemocracyEvaluationTime`, {
    method: 'get',
  });
}

// /api/team/getTeamPlayerList.do 获取关于我们的团队成员列表接口
export async function getTeamPlayerList() {
  return request(`/api/api/team/getTeamPlayerList.do`, {
    method: 'post',
  });
}


// 获取tab接口
export async function getCategoryList() {
  let fm = new FormData()
  fm.append('categoryId', 0)
  return request(`/api/cms/category/list.do`, {
    method: 'post',
    body:fm
  });
}
//tab下的列表
export async function getContentList({categoryId,pageSize}) {
  let fm = new FormData()
  fm.append('categoryId', categoryId)
  // pageNo && fm.append('pageNo',pageNo)
  pageSize && fm.append('pageSize',pageSize)
  return request(`/api/cms/content/list.do`, {
    method: 'post',
    body:fm
  });
}
//详情
export async function getCategoryGet({id}) {
  return request(`/api/cms/category/get.do?id=${id}`, {
    method: 'get',
  });
}

export async function login({account,password}) {
  let fm = new FormData()
  fm.append('account', account)
  fm.append('password', password)
  return request(`/api/api/member/memberLogin.do`, {
    method: 'post',
    body:fm
  });
}

export async function getAppSetDetail() {
  return request(`/api/api/app/getAppSetDetail.do`, {
    method: 'post',
  });
}
